home *** CD-ROM | disk | FTP | other *** search
/ GQ - Louise, World Cup, …remy Clarkson, Armageddon / GQCD.iso / files / premier / media / net.dxr / 00013_Move Left Horizontal2.ls < prev    next >
Encoding:
Text File  |  1998-05-13  |  1005 b   |  23 lines

  1. property myWidth, myOffset, mySpriteWidth
  2.  
  3. on exitFrame me
  4.   if the locH of sprite the currentSpriteNum > (mySpriteWidth * -1) then
  5.     set the locH of sprite the currentSpriteNum to the locH of sprite the currentSpriteNum - myOffset
  6.   else
  7.     set the locH of sprite the currentSpriteNum to myWidth + mySpriteWidth
  8.     set the locV of sprite the currentSpriteNum to random(400)
  9.   end if
  10. end
  11.  
  12. on getBehaviorDescription
  13.   return "This moves a sprite from left to right by a value (myOffset) across a stage which is (myWidth) wide. If it goes beyond the stage boundary it restarts at the other side."
  14. end
  15.  
  16. on getPropertyDescriptionList
  17.   set description to [:]
  18.   addProp(description, #mySpriteWidth, [#default: 25, #format: #integer, #comment: "Width of sprite:"])
  19.   addProp(description, #myOffset, [#comment: "Distance of pixels to move per frame:", #format: #integer, #default: 1])
  20.   addProp(description, #myWidth, [#comment: "Width of stage:", #format: #integer, #default: 640])
  21.   return description
  22. end
  23.